package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.PayPlanSheetUserEntity;
import com.xbongbong.saas.domain.entity.PaymentSheetUserEntity;
import com.xbongbong.saas.domain.entity.UserTeamEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/4/11 15:14
 * @since v1.0
 */
@Repository
@Mapper
public interface PayPlanSheetUserDao {
    void insertBatch(@Param("list") List<PayPlanSheetUserEntity> paySheetUserEntityList);

    void disbandedTeamBySupplierId(@Param("corpid") String corpid, @Param("supplierIdIn") List<Long> supplierIdList);

    List<PayPlanSheetUserEntity> findEntitys(@Param("param") Map<String, Object> param);

    void update(PayPlanSheetUserEntity payPlanUserEntity);

    List<UserTeamEntity> findBaseEntitys(@Param("param") Map<String, Object> map);

    void batchDeleteById(@Param("corpid") String corpid, @Param("idIn") List<Long> removeIdList);

    void batchUpdateByIdIn(@Param("corpid") String corpid, @Param("idIn") List<Long> dataIdIn, @Param("isMain") Integer isMain, @Param("del") Integer del);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    void deleteByDataIdIn(@Param("dataIdIn") List<Long> dataIds, @Param("corpid") String corpid);

    /**
     * 批量修改团队里面成员为协同人以及协同人可编辑权限
     *
     * @param corpid
     * @param idIn
     * @param isMain
     * @param formPermission
     */
    void batchUpdateCoAndPerByUserIdIn(@Param("corpid")String corpid, @Param("idIn")List<Long> idIn, @Param("isMain")Integer isMain, @Param("formPermission")Integer formPermission);

    /**
     * 根据id查询数据
     *
     * @param key    主键
     * @param corpid 公司ID
     * @return 是否成功
     * @author feng.zheng
     * @date 2019/1/23 20:00
     * @since v1.0
     **/
    PayPlanSheetUserEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     *
     * @param list
     * @param corpid
     * @param del
     */
    void deleteBatchByIdList(@Param("list") List<Long> list, @Param("corpid") String corpid, @Param("del")Integer del);
}
